PORT=10000
while [ true ]; do
    if [ `netstat -anp > /dev/null | grep ${PORT} | wc -l` -gt  ] ;then
        echo 'service is online'
    else
        echo 'service is offline'
        cd /www/wwwroot/qhy
        php think task
    fi
    sleep
done